Skip to main content

Full text of "Programming"

See other formats

InterActive 4 Dumb Terminal 


Make Projects 

build, hack, tweak, share, discover,' 

InterActive 4 Dumb Terminal 

Written By: Steven Robert Cypherd 


Basic Stamp 2(1) 


Here we are making a dumb terminal out of an old DMC 161 17A 1x16 LCD display. The first 
thing to do is to get a serial interface for the display. I am using a SparkFun SerLCD for this. 
The 161 17A only has 14 connectors and that is fine. The 15 & 16 connections on the SerLCD 
are for the back light LEDs. Just carefully cut the header and remove those connectors. 
Install the SerLCD on to the 161 17A. Connect Power, Ground and Rx to your processor port. 
Serial communications parameters are vanilla 9600 baud, 8 bits even or true, 1 Start bit, 1 
Stop bit, no parity. 

I am just using fragments of my code for this article. It is the same code I used for the Serial 
EEPROM article. I just changed the output drivers to handle the 161 17A display. 

The code text is on Let's Make Robots and Instructables . 

If you want back lights you will have to remove the mirror backing on the 161 17A. On mine 
the foil was on another piece of plastic. I removed all of it. The lights can be anything. 
Connect them plus voltage to 15 and ground on 16. 

I do not remember when I got my 161 17A. It was one of the first LCD displays available for 
processor boards way back in the mid 90's. No one did much with it because of its horrible 

© Make Projects Page 1 of 3 

InterActive 4 Dumb Terminal 

tedious parallel interface. The serial interfaces now make it great for a dumb terminal 
attached to a processor board like the Basic Stamp 2. You still have to baby this display and 
the processor board helps. Power glitches and static discharge send the 161 17A into 
uncontrollable states that only a correct series of commands can fix. The Parallax BASIC 
should be easy to translate into other systems. 

The 16117A controller is for multi-line displays. The 16 -display is really two 8-byte lines in 
the display's memory; 0-7 for the first line and 64-71 for the second line. In my program to 
make the cursor position you add the control character 128 to it. That tells SerLCD that it is 
a cursor position. The memory is a mess. See the manual. 

Having the SerLCD gives you all those pins to do other things with. Run switches for user 
feedback. Run things for the user interface. Make a bigger interactive thing. The display 
keeps the users informed. And the 161 17A looks almost normal thanks to the other 
processor board. Just to send a long string to the display you need a processor. Send first 8 
letters then set the cursor position and print the rest of the string to the display. That is what 
my interface does. 

Every processor board supports network serial communications on most of their pins. 
Networks must have the grounds connected or they will not understand each other. Minimum 
is Rx and Ground. Long network cables should be shielded twisted-pair cables. Pull-up 
resistors is all you need. About 47K. See my InterActive articles. I have not got the network 
stuff done yet, so no code file this time. I wish I had friends to share this with. I am a very 
lonely geek in LA. 

© Make Projects Page 2 of 3 

InterActive 4 Dumb Terminal 

InterActive 4 Dumb Terminal 


E ft w Rn V* Vd Vi 

Bai-b ll^bEa Q V+ L4 13 L2 9 1 | Cgp 6-5*32 1 



11 r 

'■>.>.4h.,.. >..i|.pi|...... & 1- 

lUitmHiitium.m. *"* "^ 

The SctjjlL t nt erf-are from SpL.rkFun.cnm. 

Ifit &6-00 baud even or true, 1 Start bit h 1 Stop bit, No 

Parity. Maybe re 'programmed through the ICSF port. 

Sec the manual. 

InterActive 4 

[■iter Active Thing 

"Pip -ilyrriri r/joi he; part E^f jmnr i nr-rrji-lky bhang l".'i(h i|% dUplai,-. 
hulhiirv, jnrflighh* ynip fan. cyipETHil ■f^hinit- Vguv*< rJl(i iiHrjimrnrevujr 
lihiranrrtTfl j nrur ilumh- r-nminjl bn ihpir^Hih ymar inlcr-K'i-f thinfe- 

Jn|,.<r- .1 K"i 




I li 

• o 

« I 

• ••• 


]>„ F L.l 1,|-K- 

[hi 1 LtTjuul in j | - If ■.!■■ 


w HulEiim,. M,"Jl"^ £e ^^llinii"- 
W 1 k-hl %: I nl n:nii I: :ni 

Nfhwork^uM Jitfdrpwinj .Tfeu Hmd the ID firM, If lh*H>i» fur lti*1 *ni« flier* 
1lu1 device npt *i* a wri at ocrvnectiofi lo «h* m**ltr, The reM of (ht ifcvim. wait. 
ijfh pr«?>4*r rwird »hvuld l*av* a unique ID in th« inttnttiVt tlii n£ 
Slmpflrdciie-fi like rtirSrrLCD dk> nrrt h-iv* *n jddrrcy "ifrifl uw jpwlhrr 

|KiK'THhiH fniM hi iun HLrijI Ell ihrhr -di/vi.-: fi. 
EjlIi butliMi jiiiiJ ki^li! u^n j |'iirl 

Stc:jI Dl'vk rs u"%r t me mini- j'lirl's -rjLh. Ea 3.. Ta Ij, Eflun -CaniLBiiiJ 

EjJi ir-kin- un Iuvl- its |icivn, (Sut Ihr € ■raimih muit Ik: lOTiririir-J. 

InterActive 4 A u.i i?a fix 

The- ItLl.f A lii. fn jit. ufobmm s* h 

r-r ii fflv Fix IW ilut liJ& Jitpti}'. 

.\,3 zttibcn. j.:r in 1 fc-. mill C^iiinn4.r>J 

— }-■■■■• I :-:■!■; I^j:ii 

ELaEEE cap-1 ■ aft Taaal 

j-i — .ail a« 

utaui J tnE** *i.tJ"9 * eg MfPl*^ =Pi 


tr twpl- a >[■ Txn 

.'InLici Lb* ria 

TTW C»pJ ■ i n H 

/■^il. k4 4¥*b 

iiifctK- fiapS , at, [Elf trimat] 

JEJUU7 Xup* , 44, [CwpPuuc] 

fat * ni: BL *1, ■ I Demi, P Ij? 

r*V5I 1 

/bWU liana i 


;p\^4>+r lLm# 3 

t* ■ : 


hdAVF fetpi.., ♦l,B*p<W^ 

JEautt Supt. ii,|AipCi"«: 

/t± a «a b ecl, e eft, a nil 

M.7BE J 

JDJ.ip]*y On 

■■mvrB*pL. *4. isv(Oki>lE 

■■■r'JEK'l «II 

ft*Mft-tvpi-. ♦(.Kwfftirfr 

miik 4it 


imnriiapL. ti. itmpcm&u 

9EKVT3VPI. aH.liwiXrjl.tEl 

/I ■ CLHI ■llipllj- 

t*»4t t 

lEair-JF ftapL. ti , |£ap«m±Lt 

lEJWPSfpL, ai. [3«pM**r| 

JeKME 1 

5E»«TT SapL. iH.I'Dcoa'l 


i*att »crli*ji&ii 


Bv Sifwfn P- C>i**ri3 Serial LCD interface 
Dumb Terminal 

16117A FIX 

InterActive 4 

16 11 7 A Displaying a Long String 

Because of the 16117A controller being for multiline displays the addressing is a mess. 

Hello DMC16117A 

- 764 - 71 

MyStr is 17 bytes, 
one. Insert a zero. 
cursor to 64. Move 
Add 0. Print It. 
Hello DM0C16117A 

The 1 line 16117A is two 8 byte lines 64 
bytes from the first line. 


I move Hi 8 up by 

Print It. Set 
Hi 8 to front. 

mystr(tmp4) = mystr<tmp3) 
tmp4 = tmp4 - 1 /Mov* Hi 8 Up one 
tmp3 = tnip3 - 1 
LOOP UHTIL [tmp3 < 8) 

Print Hello DM 

Print C16117A 


Display Hello DMC16117A 

IF DSpStr = THEN JiODspStr 
DEBUG DEC tmpl , ". * , STE tlliyStr r OR 
BEROUT Dapl r 84, [DapCmdl] 
SEROUT Dapl, 84. [DspCl*ar] 

FOR tuip2 = TO 15 'Go throu9h Etriiag 
IF mystr (trap2) = AND tmp2 < 3 THEN 
SEROUT Dapl, 84, [STR BiyStr] 
IF tnip2 = 3 THEN /start second line 
trap4 =16 

tap:* = is By Steven R Cypherd 

B4, [STR mystr] 

12 3 'Set Address to Line 2 

B4, [DspQndll 
B4, [tmp3] 

+ 1 

raystr < tmp2 ) 
t1tip3 = 64 + 
tmp3 = D 
tmp4 = tmp2 

mystr(trap3) = mystr{tnLp4) 

tmp3 = tmp3 + l /Kove Hi B to front 

Ltivpi = L!np4 + 1 

LOOP UNTIL (tmp3 > 1) 

raystr(8) = 

SEROUT Dspl, B4, [STR myStr] 
NEST r Go through etring 
iiODi;pSix : 

IF DspStr = THEH 

debug dec tcnpi, ■., n , str mystr r CE 


DspStr = 

NEXT 'Read in strings 
HIGH epes 'Set Chip select High - close command 
epAddr = mystrs * 16 /Reset Address 
goto cmdDisplay 

Display a long String 


This document was last generated on 201 3-01 -06 06:29:02 AM. 

© Make Projects 

Page 3 of 3